<?php

use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\MusicController;
use App\Http\Controllers\Admin\MusicParagraphConfigController;
use App\Http\Controllers\Admin\MusicParagraphController;
use App\Http\Controllers\Admin\MusicParagraphSentenceConfigController;
use App\Http\Controllers\Admin\MusicParagraphSentenceController;
use App\Http\Controllers\Admin\MusicTypeController;
use App\Http\Controllers\Admin\MusicTypeMenuController;
use App\Http\Controllers\Admin\RoleController;
use App\Http\Controllers\Admin\UploadController;
use App\Http\Controllers\Admin\UserController;
use App\Http\Middleware\AdminAuthMiddleware;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::prefix("/admin/")->middleware(AdminAuthMiddleware::class)->group(function (){
    Route::get("index", [IndexController::class, "index"])->name("adminIndex");

    Route::get("role/index", [RoleController::class, "index"])->name("adminRoleIndex");
    Route::get("role/edit", [RoleController::class, "edit"])->name("adminRoleEdit");
    Route::post("role/update", [RoleController::class, "update"])->name("adminRoleUpdate");
    Route::get("role/create", [RoleController::class, "create"])->name("adminRoleCreate");
    Route::post("role/save", [RoleController::class, "save"])->name("adminRoleSave");
    Route::get("role/delete", [RoleController::class, "delete"])->name("adminRoleDelete");

    Route::get("user/index", [UserController::class, "index"])->name("adminUserIndex");
    Route::get("user/edit", [UserController::class, "edit"])->name("adminUserEdit");
    Route::post("user/update", [UserController::class, "update"])->name("adminUserUpdate");
    Route::get("user/create", [UserController::class, "create"])->name("adminUserCreate");
    Route::post("user/save", [UserController::class, "save"])->name("adminUserSave");
    Route::get("user/delete", [UserController::class, "delete"])->name("adminUserDelete");

    Route::get("musicType/index", [MusicTypeController::class, "index"])->name("adminMusicTypeIndex");
    Route::get("musicType/edit", [MusicTypeController::class, "edit"])->name("adminMusicTypeEdit");
    Route::post("musicType/update", [MusicTypeController::class, "update"])->name("adminMusicTypeUpdate");
    Route::get("musicType/create", [MusicTypeController::class, "create"])->name("adminMusicTypeCreate");
    Route::post("musicType/save", [MusicTypeController::class, "save"])->name("adminMusicTypeSave");
    Route::get("musicType/delete", [MusicTypeController::class, "delete"])->name("adminMusicTypeDelete");

    Route::get("musicTypeMenu/index", [MusicTypeMenuController::class, "index"])->name("adminMusicTypeMenuIndex");
    Route::get("musicTypeMenu/edit", [MusicTypeMenuController::class, "edit"])->name("adminMusicTypeMenuEdit");
    Route::post("musicTypeMenu/update", [MusicTypeMenuController::class, "update"])->name("adminMusicTypeMenuUpdate");
    Route::get("musicTypeMenu/create", [MusicTypeMenuController::class, "create"])->name("adminMusicTypeMenuCreate");
    Route::post("musicTypeMenu/save", [MusicTypeMenuController::class, "save"])->name("adminMusicTypeMenuSave");
    Route::get("musicTypeMenu/delete", [MusicTypeMenuController::class, "delete"])->name("adminMusicTypeMenuDelete");

    Route::get("music/index", [MusicController::class, "index"])->name("adminMusicIndex");
    Route::get("music/edit", [MusicController::class, "edit"])->name("adminMusicEdit");
    Route::post("music/update", [MusicController::class, "update"])->name("adminMusicUpdate");
    Route::get("music/create", [MusicController::class, "create"])->name("adminMusicCreate");
    Route::post("music/save", [MusicController::class, "save"])->name("adminMusicSave");
    Route::get("music/delete", [MusicController::class, "delete"])->name("adminMusicDelete");

    Route::get("musicParagraph/index", [MusicParagraphController::class, "index"])->name("adminMusicParagraphIndex");
    Route::get("musicParagraph/edit", [MusicParagraphController::class, "edit"])->name("adminMusicParagraphEdit");
    Route::post("musicParagraph/update", [MusicParagraphController::class, "update"])->name("adminMusicParagraphUpdate");
    Route::get("musicParagraph/create", [MusicParagraphController::class, "create"])->name("adminMusicParagraphCreate");
    Route::post("musicParagraph/save", [MusicParagraphController::class, "save"])->name("adminMusicParagraphSave");
    Route::get("musicParagraph/delete", [MusicParagraphController::class, "delete"])->name("adminMusicParagraphDelete");

    Route::get("musicParagraphSentence/index", [MusicParagraphSentenceController::class, "index"])->name("adminMusicParagraphSentenceIndex");
    Route::get("musicParagraphSentence/edit", [MusicParagraphSentenceController::class, "edit"])->name("adminMusicParagraphSentenceEdit");
    Route::post("musicParagraphSentence/update", [MusicParagraphSentenceController::class, "update"])->name("adminMusicParagraphSentenceUpdate");
    Route::get("musicParagraphSentence/create", [MusicParagraphSentenceController::class, "create"])->name("adminMusicParagraphSentenceCreate");
    Route::post("musicParagraphSentence/save", [MusicParagraphSentenceController::class, "save"])->name("adminMusicParagraphSentenceSave");
    Route::get("musicParagraphSentence/delete", [MusicParagraphSentenceController::class, "delete"])->name("adminMusicParagraphSentenceDelete");



    Route::get("musicParagraphConfig/edit", [MusicParagraphConfigController::class, "edit"])->name("adminMusicParagraphConfigEdit");
    Route::post("musicParagraphConfig/save", [MusicParagraphConfigController::class, "save"])->name("adminMusicParagraphConfigSave");


    Route::get("musicParagraphSentenceConfig/edit", [MusicParagraphSentenceConfigController::class, "edit"])->name("adminMusicParagraphSentenceConfigEdit");
    Route::post("musicParagraphSentenceConfig/save", [MusicParagraphSentenceConfigController::class, "save"])->name("adminMusicParagraphSentenceConfigSave");


    Route::post("upload", [UploadController::class, "upload"])->name("adminUpload");



});

Route::get("/admin/login", [LoginController::class, "login"])->name("adminLogin");
Route::post("/admin/doLogin", [LoginController::class, "doLogin"])->name("adminDoLogin");
Route::get("/admin/logout", [LoginController::class, "logout"])->name("adminLogout");


Route::get('/', function () {
    return view('welcome');
});

